package com.ruoyi.riskAssessment.service.impl;

import java.util.List;

import com.ruoyi.riskAssessment.vo.RiskEventConsequencesVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.riskAssessment.mapper.RiskEventConsequencesMapper;
import com.ruoyi.riskAssessment.domain.RiskEventConsequences;
import com.ruoyi.riskAssessment.service.IRiskEventConsequencesService;

/**
 * 危险源-事件后果严重性(S)Service业务层处理
 *
 * @author lth
 * @date 2023-12-15
 */
@Service
public class RiskEventConsequencesServiceImpl implements IRiskEventConsequencesService
{
    @Autowired
    private RiskEventConsequencesMapper riskEventConsequencesMapper;

    /**
     * 查询危险源-事件后果严重性(S)
     *
     * @param id 危险源-事件后果严重性(S)主键
     * @return 危险源-事件后果严重性(S)
     */
    @Override
    public RiskEventConsequences selectRiskEventConsequencesById(Long id)
    {
        return riskEventConsequencesMapper.selectRiskEventConsequencesById(id);
    }

    /**
     * 查询危险源-事件后果严重性(S)列表
     *
     * @param riskEventConsequences 危险源-事件后果严重性(S)
     * @return 危险源-事件后果严重性(S)
     */
    @Override
    public List<RiskEventConsequences> selectRiskEventConsequencesList(RiskEventConsequences riskEventConsequences)
    {
        return riskEventConsequencesMapper.selectRiskEventConsequencesList(riskEventConsequences);
    }

    /**
     * 新增危险源-事件后果严重性(S)
     *
     * @param riskEventConsequences 危险源-事件后果严重性(S)
     * @return 结果
     */
    @Override
    public int insertRiskEventConsequences(RiskEventConsequences riskEventConsequences)
    {
        return riskEventConsequencesMapper.insertRiskEventConsequences(riskEventConsequences);
    }

    /**
     * 修改危险源-事件后果严重性(S)
     *
     * @param riskEventConsequences 危险源-事件后果严重性(S)
     * @return 结果
     */
    @Override
    public int updateRiskEventConsequences(RiskEventConsequences riskEventConsequences)
    {
        return riskEventConsequencesMapper.updateRiskEventConsequences(riskEventConsequences);
    }

    /**
     * 批量删除危险源-事件后果严重性(S)
     *
     * @param ids 需要删除的危险源-事件后果严重性(S)主键
     * @return 结果
     */
    @Override
    public int deleteRiskEventConsequencesByIds(Long[] ids)
    {
        return riskEventConsequencesMapper.deleteRiskEventConsequencesByIds(ids);
    }

    /**
     * 删除危险源-事件后果严重性(S)信息
     *
     * @param id 危险源-事件后果严重性(S)主键
     * @return 结果
     */
    @Override
    public int deleteRiskEventConsequencesById(Long id)
    {
        return riskEventConsequencesMapper.deleteRiskEventConsequencesById(id);
    }


    /**     通过schemeId获取实践后果列表
    * @Author lth
    * @Description //TODO
    * @Date 16:54 2023/12/15
    * @Param
    * @return
     **/
    @Override
    public List<RiskEventConsequences> listById(RiskEventConsequencesVo vo) {
        Long schemeId = vo.getSchemeId();
        List<RiskEventConsequences> riskEventConsequencesList = riskEventConsequencesMapper.listById(schemeId);
        return riskEventConsequencesList;
    }
}
